package com.yx1996.service;

import com.yx1996.dao.UserDao;
import com.yx1996.domain.User;

import java.sql.SQLException;

public class UserService {

	UserDao userDao = new UserDao();
	public boolean registe(User user) throws SQLException {
		int row = userDao.registe(user);
		return row>0?true:false;
	}

	public void active(String activeCode) throws SQLException {
		userDao.active(activeCode);
	}

	public boolean findUserByUsername(String username) throws SQLException {
		long row = userDao.findUserByUsername(username);
		return row>0?true:false;
	}

	public User login(String username, String password) throws SQLException {
		UserDao userDao = new UserDao();
		return userDao.login(username,password);
    }
}
